﻿using System;
using System.Collections.Generic;
using System.Text;
using NIIT.SaoBacDau.Aupi.HospitalManagement.Entities;
using System.Data.SqlClient;
using System.Data;

namespace NIIT.SaoBacDau.Aupi.HospitalManagement.DataAccess
{
    public class DAO_HR_TypeEmployee
    {
        public static HR_TypeEmployee hrTypeE(HR_TypeEmployee hR_TypeEmployee)
        {
            SqlDataAdapter sqlda = new SqlDataAdapter("HumanResources.HRTypeEmployee", DAO_ConnectDatabase.Connect());
            sqlda.SelectCommand.CommandType = CommandType.StoredProcedure;
            sqlda.SelectCommand.Parameters.Add("@TypeEmployeesID", SqlDbType.Int).Value = hR_TypeEmployee.TypeEmployeeID;
            DataTable dtable = new DataTable();
            sqlda.Fill(dtable);
            HR_TypeEmployee hr_TypeEm = new HR_TypeEmployee();
            hr_TypeEm.TypeEmployeeID = hR_TypeEmployee.TypeDoctorID;
            hr_TypeEm.NameTypeEmployee = dtable.Rows[0]["NameTypeEmployees"].ToString();
            hr_TypeEm.TypeDoctorID = Convert.ToInt32(dtable.Rows[0]["TypeDoctorID"].ToString());
            return hr_TypeEm;
        }
    }
}
